<%--
  Created by IntelliJ IDEA.
  User: 彭海鑫
  Date: 2021/9/16
  Time: 15:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="/untitled2_war_exploded/kaoshi/jquery-1.12.4.js"></script>
    <script type="text/javascript">
        $(function () {

            function name() {
                let name = $("#name").val();
                if (name==""){
                    alert("姓名不能为空");
                    return false;
                }
                return true;
            }
            function sex() {
                let sex = $("#sex").val();
                if (sex==""){
                    alert("性别不能为空");
                    return false;
                }
                return true;
            }
            function age() {
                let age = $("#age").val();
                if (age==""){
                    alert("年龄不能为空");
                    return false;
                }
                return true;
            }
            function rank() {
                let rank = $("#denj").val();
                if (rank==""){
                    alert("等级不能为空");
                    return false;
                }
                return true;
            }
            function bumeng() {
                let bumeng = $("#bume").val();
                if (bumeng==""){
                    alert("部门不能为空");
                    return false;
                }
                return true;
            }
            function tijiao() {
                let istrue = false;
                if (name()==false||sex()==false||age()==false||rank()==false||bumeng()==false){
                    istrue = false;
                }

                return istrue;
            }
            $("form").submit(tijiao);
        })
    </script>
</head>
<body>
<form method="post" name="xinzen" action="/untitled2_war_exploded/xinzenServlet">
    编号：<input type="text" name="id" id="id" value="${param.id}"><br/>
    姓名：<input type="text" name="name" id="name" value="${param.name}"><br/>
    性别：<input type="text" name="sex" id="sex" value="${param.sex}"><br/>
    年龄：<input type="text" name="age" id="age" value="${param.age}"><br/>
    等级：<input type="text" name="denj" id="denj" value="${param.rank}"><br/>
    部门：<input type="text" name="bume" id="bume" value="${param.bumeng}"><br/>
    <input type="submit" value="新增">
</form>
</body>
</html>
